package com.thousandsunny.producer;

import com.alibaba.fastjson.JSON;
import com.thousandsunny.dal.repository.SimpleUserRepository;
import com.thousandsunny.dal.repository.UserRepository;
import com.thousandsunny.userInterface.UserInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Savitar
 */
@RestController
public class UserFacade implements UserInterface {

    @Autowired
    private UserRepository userRepository;
    @Autowired
    private SimpleUserRepository simpleUserRepository;

    @Override
    public Integer userDetail(Integer id) {
        System.out.println("====================" + id);
        System.out.println("====================" + JSON.toJSONString(userRepository.findById(2L)));
        System.out.println("====================" + JSON.toJSONString(simpleUserRepository.findById(2L)));
        return id;
    }
}
